package com.teamcenter.rac.massupdate.converters;

import org.eclipse.core.databinding.conversion.IConverter;

import com.teamcenter.rac.massupdate.model.UpdateJobModel;

public class OperationType2OperationIndexConverter
  implements IConverter
{
  public Object convert(Object paramObject)
  {
    for (int i = 0; i < UpdateJobModel.OperationType.ORDERRED_OP_TYPES.length; i++) {
      if (UpdateJobModel.OperationType.ORDERRED_OP_TYPES[i].equals(paramObject)) {
        return Integer.valueOf(i);
      }
    }
    return Integer.valueOf(0);
  }
  
  public Object getFromType()
  {
    return UpdateJobModel.OperationType.class;
  }
  
  public Object getToType()
  {
    return Integer.class;
  }
}
